package com.gowants.pems.mapper;

import com.gowants.pems.model.EquipmentType;
import com.gowants.pems.model.Supplier;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EquipmentTypeMapper {

    /**
     * 检索
     * @return
     */
    public List<EquipmentType> select(@Param("equipmentType") EquipmentType equipmentType);

    /**
     * 根据ID检索供应商
     * @param id
     * @return
     */
    public EquipmentType selectById(String id);

    /**
     * 获取子级数量
     * @param pid
     * @return
     */
    public int selectByPid(String pid);

    /**
     * 新增
     * @param equipmentType
     * @return
     */
    public int insert(EquipmentType equipmentType);

    /**
     * 修改
     * @param equipmentType
     * @return
     */
    public int update(@Param("equipmentType") EquipmentType equipmentType);

    /**
     * 删除
     * @param id
     * @return
     */
    public int delete(String id);

    /**
     * 检查名称是否存在
     * @param name
     * @return
     */
    public int checkName(String name);

    /**
     * 根据id判断名称是否存在
     * @param name
     * @param id
     * @return
     */
    public int checkNameById(@Param("name") String name, @Param("id") String id);
}
